import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '@/views/HomeView.vue'
import Child from '@/views/ChildView.vue'
import Son from '@/views/SonViews.vue'
import HomeFirst from '@/views/home/HomeFirstView.vue'
import HomeTwo from '@/views/home/HomeTwoView.vue'
import Cpt from '@/views/computView.vue'
const routes = [
  {
    path: '/home',
    component: Home,
    children: [
      { name: 'first', path: 'first', component: HomeFirst },
      { name: 'homfirst', path: '/home/first/:id', component: HomeFirst },
      { name: 'two', path: 'two', component: HomeTwo },
      { path: '/home', redirect: '/home/first' }
    ]
  },
  {
    path: '/child',
    component: Child,
    children: [
      {
        path: '/child/first',
        component: () => import('@/views/child/ChildFirstView.vue')
      }
    ]
  },
  { path: '/son', component: Son },
  { path: '/:pathMath(.*)', redirect: '/home' },
  { path: '/cpt/:id', component: Cpt },
  {
    path: '/serv',
    component: () => import('@/views/servViews.vue')
  }
]
const router = createRouter({
  history: createWebHashHistory(),
  routes
})
export default router
